<template>
	<view class="">
		
	
	<view class="servelist" v-if="integralType==1">
		<view v-for="(item,index) in list" :key="index" class="serve">
			 
			<view class="s1">
				<view class="">{{item.title}}</view>
				<view  >{{item.point}}</view>
				 
			</view>
			<view class="s2">
				<view class="">{{item.createTime | formatDate}}</view>
				<view>积分余额 {{item.totalPoint}}</view>
			</view>
		</view>
	</view>
	<view class="servelist" v-if="integralType==2">
		<view v-for="(item,index) in list" :key="index" class="serve">
			 
			<view class="s1">
				<view class="">{{item.name}}-{{item.title}}</view>
				 
				<view style="color:#277EEF ;" v-if="item.price>0">+{{item.price}}</view>
				<view style="color:#333 ;" v-else>{{item.price}}</view>
			</view>
			<view class="s2">
				<view class="">{{item.createTime | formatDate}}</view>
				<view>{{item.name}} {{item.balance}}</view>
			</view>
		</view>
	</view> 
	<!-- 账单记录 -->
	<view class="servelist" v-if="integralType==3">
		<view v-for="(item,index) in list" :key="index" class="serve">
			 
			<view class="s1">
				<view class="">{{item.title}}</view> 
 				<view style="color:#333 ;">{{item.money}}</view>
			</view>
			<view class="s2">
				<view class="">{{item.createTime | formatDate}}</view>
				<view> </view>
			</view>
		</view>
	</view> 
	</view> 
</template>

<script>
	export default {
		name:"integralList",
		props:{
			value:{
				default:[],
				type: [Array, Object],
			},
			integralType:{
				default:"1",
				type: [Number, String],
			}
		},
		watch:{
			value:{
				deep: true,
				handler(val, oldValue) {
					if(val.length){
						this.list=val
						console.log(this.list)
					}else{
						this.list=[]
					}
				}
			}
		},
		filters:{
			statusStr(val){
				if(val>=0 && val<=7){
					// 1 提现 2 充值 3 退款 4支付	
					let stutus=["","提现","充值","退款","支付" ]
					return stutus[val]
				}else{
					val
				}
				
			}
		},
		mounted() {
			this.list=this.value
		},
		data() {
			return {
				list: [],
			};
		}
	}
</script>

<style lang="scss" scoped>
	.servelist{
		padding: 20rpx;
		.serve{
			margin-bottom: 20rpx;
			 
			width: 100%;
			padding:25rpx 20rpx;
			border-bottom: 1rpx solid #EEEEEE;
			view{
				display: flex;
				align-items: center;
				justify-content: space-between;
			}
			.s1{
				font-weight: bold;
				font-size: 28rpx;
				color: #333333; 
			}
			.s2{
				margin-top: 15rpx;
				view{
					font-weight: 400;
					font-size: 24rpx;
					color: #999999;
				 
				}
			}
			 
		}
	}

</style>